package com.gagakuai.engine.impl.pvm.process;

import com.gagakuai.engine.impl.delegate.ActivityBehavior;
import com.gagakuai.engine.impl.pvm.PvmActivity;
import com.gagakuai.engine.impl.pvm.PvmTransition;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/*
 * @program: common-starters
 * @description: 活动实现类
 * @author: houhong
 * @create: 2023-01-02 13:41
 */
public class ActivityImpl extends ScopeImpl implements PvmActivity, HasDIBounds {


    /*
     * 获取到当前活动的出线集合
     */
    protected List<PvmTransition> outGoingTransitions = new ArrayList<>();

    protected Map<String, PvmTransition> nameOutGoingTransitions = new ConcurrentHashMap<>();

    protected Map<String, Object> variables = new HashMap<>();

    protected List<PvmTransition> incomingTransitions = new ArrayList<>();

    /*
     * 当前活动的行为
     */
    protected ActivityBehavior activityBehavior;
    /*
     * 是否是在当前范围
     */
    protected boolean isScope;
    /*
     * 是否是异步
     */
    protected boolean isAsync;
    /*
     * 是否是排他节点
     */
    protected boolean isExclusive;
    protected String failedJobRetryTimeCycleValue;



    /*=======坐标========*/
    protected int x = -1;
    protected int y = -1;
    protected int width = -1;
    protected int height = -1;


    public ActivityImpl(String id, ProcessDefinitionImpl processDefinition) {
        super(id, processDefinition);
    }



    public ActivityBehavior getActivityBehavior() {
        return activityBehavior;
    }

}